package com.xiaowei.aidemo1.utils;

import com.baidu.aip.ocr.AipOcr;
import org.json.JSONObject;
import java.util.HashMap;

public class AiUtils {
    //设置APPID/AK/SK
    public static final String APP_ID = "31429591";
    public static final String API_KEY = "efBdig568aljDeuqYdDCA1i1";
    public static final String SECRET_KEY = "oSacp29Q8Amkp4kiVWG20hd5y7ZceuSk";

    public static void main(String[] args) {

        AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);
        // 调用接口
        String path = "E:\\复试\\ai-demo1-master\\20230319102545.png";
        JSONObject res = client.basicGeneral(path, new HashMap<String, String>());
        System.out.println(res);
    }
}
